package com.pilipili.service;

import com.pilipili.dao.UserMapper;
import com.pilipili.pojo.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("UserServiceImpl")
public class UserServiceImpl implements UserService{

    @Autowired
    @Qualifier("userMapper")
    private UserMapper userMapper;

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public Users selectUser( String username) {
        return userMapper.selectUser(username);
    }

    @Override
    public int insert(Users users) {
        return userMapper.insertUser(users);
    }

    @Override
    public List<Users> selectAllUser() {
        return userMapper.selectAllUser();
    }

    @Override
    public int deleteUser(String username) {
        return userMapper.deleteUser(username);
    }

    @Override
    public int updateUser( Users users) {
        return userMapper.updateUser(users);
    }
}